<template>
    <div>
      <el-button type="primary" @click="show=true">显示</el-button>
      <dept ></dept>


      <!-- <button @click="prePage">上一页</button>
      <button @click="nextPage">下一页</button>
      <div style="margintop: 10px; color: #409eff">
        {{ pageNum }} / {{ pageTotalNum }}
      </div>
      <pdf
        :page="pageNum"
        :src="url"
        @progress="loadedRatio = $event"
        @num-pages="pageTotalNum = $event"
      ></pdf> -->
    </div>
</template>
  <script>
  import pdf from "vue-pdf";
  import dept from "./dept.vue"
  export default {
    components: {
      pdf,
      dept
    },
    data() {
      return {
        show:false,
        url: "http://storage.xuetangx.com/public_assets/xuetangx/PDF/PlayerAPI_v1.0.6.pdf",
        pageNum: 5,
        pageTotalNum: 1, //总页数
        loadedRatio: 0, //当前页面的加载进度，范围是0-1 ，等于1的时候代表当前页已经完全加载完成了
      };
    },
    created() {},
    methods: {
      // 上一页
      prePage() {
        let page = this.pageNum;
        page = page > 1 ? page - 1 : this.pageTotalNum;
        this.pageNum = page;
      },
  
      // 下一页
      nextPage() {
        let page = this.pageNum;
        page = page < this.pageTotalNum ? page + 1 : 1;
        this.pageNum = page;
      },
    },
  };
  </script>
  